// 导入ex模块
const express = require('express')
let Mock = require('mockjs');
const { getVillageListByCity, villageList } = require('./village_data')
//2.创建路由对象
const router = express.Router()

router.get('/getuserlist/:city', (request, response) => {
  let city = request.params.city
  let list =getVillageListByCity(city)
  let back = {
    "total": list.length,
    "rows": list,
    "code": 200,
    "msg": "查询成功"
  }
  response.send(back)
})
//向外导出路由对象
module.exports = router